package exception;

@EqualsAndHashCode(callSuper = true) //为true，会先比较父类的字段,为false，只比较子类的字段
public class ServiceException extends RuntimeException{
    /*
    异常码
     */
    private Integer code;

    private String message;
    //为了序列化
    public ServiceException(){

    }
    public ServiceException(Integer code,String message){
        this.code=code;
        this.message=message;
    }
    public ServiceException(ErrorCode errorcode){
        this.code=errorcode.getCode();
        this.message=errorcode.getMsg();
    }



}
